package org.seed.quantum.protocol;

import org.seed.quantum.socket.AbstractSocketSession;
import org.seed.quantum.socket.Protocol;

import java.nio.ByteBuffer;

public class LongProtocol implements Protocol<Long> {

    @Override
    public Long decode(ByteBuffer data, AbstractSocketSession session) {
        if (data.remaining() < Long.BYTES)
            return null;
        return data.getLong();
    }
}
